<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file = "../taglib.jsp" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>国药360积分支付</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="gkjk">

    <!-- Site CSS -->

    <link href="${pageContext.request.contextPath}/res/css/jf360.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.request.contextPath}/res/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
var m = 60*1000;   //控制发送按钮时间
var youtime = m;//显示倒计时数字
function onclickSmsCheckBtn(){
	//$('#smsCheckBtn').hide();
	$('#smsCheckBtn').attr('disabled',true);
	//$("#smsCheckBtn").attr({"disabled":"disabled"});
	//$('#smsCheckBtnShow').show();
	var telephone = document.form.mobile.value;
	   $.ajax({
		type : "post",
		url : "${pageContext.request.contextPath}/web/getSMSVerifCode",
		data : {
			telephone : telephone
		},
		dataType : "json",
		cache : false,
		async : false,
		success : function(data) {
			if(data.status=="0000"){
				 $('#sessionId').val(data.sessionId); 
				alert("发送成功");
			}else if(data.status=="1001"){
				alert("发送失败，请重新发送");
			}else if(data.status=="1002"){
				alert("发送失败");
			}
		}
	});   
   var t=setInterval(function(){time()},1000);
 	setTimeout(function(){	
		 youtime = m;
		 clearTimeout(t);
		 $('#smsCheckBtn').attr('disabled',false);
    	 document.getElementById("smsCheckBtnShow").innerHTML="";
	},m); 
	
}

function time(){
	youtime = youtime - 1000; 
	document.getElementById("smsCheckBtnShow").innerHTML="请稍后("+youtime/1000+")";
}
</script>
</head>
<body>
    <div class="jf-top-bg">
        <div class="jf-top">
            <ul class="jf-form">
                <li class="jf-lbl">订单编号：</li>
                <li>
                    <p>${order_id }</p>
                </li>
            </ul>
            <div class="jf-form-clearfix"></div>
            <ul class="jf-form">
                <li class="jf-lbl">应付金额：</li>
                <li>
                    <p class="jf-money-hight">${fee }元</p>
                </li>
            </ul>

        </div>
    </div>
    <div class="jf-content-bg">
        <div class="jf-content">
            <div class="jf-title">国药360积分支付</div>
            
            <div class="jf-form-wrapped">
                <form name="form" action="${pageContext.request.contextPath}/web/doPay.action" method="post">
                	<input type="hidden" name="local_pay_ssn" value="${local_pay_ssn}">
                	<input type="hidden" name="order_id" value="${order_id}">
                	<input type="hidden" name="fee" value="${fee}">
                	<input type="hidden" name="channel_id" value="${channel_id}">
                	<input type="hidden" id="buyer_token" name="buyer_token" value="${buyer_token}">
                	<input type="hidden" name="channel_type" value="${channel_type}">
                	<input type="hidden" name="mobile" value="${mobile}">
                	
                	<input type="hidden" name="mer_id" value="${mer_id}">
                	<input type="hidden" name="input_charset" value="${input_charset}">
                	<input type="hidden" name="version" value="${version}">
                	<input type="hidden" name="language" value="${language}">
                	<input type="hidden" name="sign_type" value="${sign_type}">
                	<input type="hidden" name="userid" value="${userid}">
                	<input type="hidden" id ="sessionId" name="sessionId" value="">
                    <ul class="jf-form">
                        <li class="jf-lbl lbl-form">手机号码：</li>
                        <li>
                            <input type="text" class="form-control" value="${mobile}" readonly="true">
                            <input class="btn btn-default" type="button" id="smsCheckBtn" name="smsCheckBtn" onclick="onclickSmsCheckBtn()" value="获取短信验证码">
                        </li>
                    </ul>
                    <div class="jf-form-clearfix"></div>
                    <ul class="jf-form">
                        <li class="jf-lbl lbl-form">短信验证码：</li>
                        <li>
                            <input type="text" name="buyer_voucher" placeholder="请输入短信验证码" class="form-control">
                            <span class="msg-info" id="smsCheckBtnShow"></span>
                        </li>
                    </ul>
                    <div class="jf-form-clearfix"></div>
                    <div class="jf-space-1"></div>
                    <div>
                        <input type="submit" class="btn-pay" value="支付">
                    </div>
                </form>
            </div>
        </div>
    </div>


</body>
</html>